//
//  UIButton+Extension.swift
//  新浪微博
//
//  Created by bin on 16/1/23.
//  Copyright © 2016年 XMG. All rights reserved.
//

import UIKit

extension UIButton{

    convenience init(imageName: String, backgroundImage: String){
        self.init(backgroundImage:backgroundImage)
        setImage(UIImage(named: imageName), forState: .Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
    }
    
    convenience init(backgroundImage: String){
        self.init()
        setBackgroundImage(UIImage(named: backgroundImage), forState: .Normal)
        setBackgroundImage(UIImage(named: backgroundImage + "_highlighted"), forState: .Highlighted)
        sizeToFit()
    }
}